<?php
/**
 * Created by PhpStorm.
 * User: songs
 * Date: 2019/11/20
 * Time: 10:14
 */

namespace App\Services\Api;

use App\admin\Service\OA;
use App\Jobs\Fun;
use App\Models\Admin\CompanyModel;
use App\Models\Admin\JobModel;
use App\Models\Admin\JobStaffModel;
use App\Models\Admin\OrderBaleModel;
use App\Models\Admin\OrderCheckModel;
use App\Models\Admin\OrderTempModel;
use App\Models\Admin\StaffModel;
use App\Models\JobsCompanysModel;
use App\Models\LogModel;
use App\Models\OrderCommentModel;
use App\Models\UploadPicModel;
use App\Models\User\UserLevelModel;
use App\Models\User\UserModel;
use App\Models\UserStaffModel;
use App\Models\UserStaffOptionModel;
use App\Services\Jiguang\JMessageApi;
use App\Services\OrdersPayService;
use App\Utilities\Imgcompress;
use Illuminate\Http\Request;
use App\Models\MoneyBilModel;
use DB;
use App\Models\User\UserOrdersModel;
use App\Services\Msg\MsgService;

/// App\Services\Api\JobCompanys@
class JobCompanys extends ApiBase
{
    public function getjobcompanysinfo(){
        $id=$_POST['id']??"";
        $uid=OA::$user->getId();
        $one=JobsCompanysModel::where([
            'id'=>$id
        ])->first();
        if(!$one){
            OA::Json(1,'岗位信息不存在,可能已经删除');
        }
        if($one->cid!==$uid){
            OA::Json(1,"本岗位不是您发布的,所以无法编辑");
        }
        $array=$one->toArray();
        $array['job_name']=JobModel::getName($array['job']);
        OA::Json(0,$array);
    }

}